package com.baizhi.appcontroller;

import com.baizhi.entity.CmfzLessonClass;
import com.baizhi.service.CmfzLessonClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: renpu
 * @Date: 2019/3/7 19:43
 * @Description:
 */
@RestController
@RequestMapping("/lessonClass")
public class AppLessonClassController {

    @Autowired
    private CmfzLessonClassService lessonClassService;

    @GetMapping("selectIdClass/{userId}")
    public List<CmfzLessonClass> selectIdClass(@PathVariable("userId") int userId){
        return lessonClassService.selectIdClass(userId);
    }

    @DeleteMapping("deleteIdLesson/{lessonClassId}")
    public void deleteIdLesson(@PathVariable("lessonClassId") int lessonClassId){
        lessonClassService.deleteIdLesson(lessonClassId);
    }

    @PostMapping("addClass")
    public void addClass(String lessonName,int userId){
        lessonClassService.addClass(lessonName,userId);
    }
}
